package com.bjc.demo.listener;

import org.activiti.engine.delegate.DelegateTask;
import org.activiti.engine.delegate.TaskListener;

/**
 * @program: activiti_review
 * @description: activiti事件监听器
 * @author: bjc
 * @create: 2021-12-03 22:12
 */
public class MyTaskListener implements TaskListener {

    /**
     * 指定负责人
     * @param delegateTask
     */
    @Override
    public void notify(DelegateTask delegateTask) {
        //判断当前的任务是创建申请并且是create事件
        if ("创建申请".equals(delegateTask.getName())&&
            "create".equals(delegateTask.getEventName())){
            delegateTask.setAssignee("张三");
        }
    }
}
